<?php

use think\facade\Route;

//多应用模式/下载多模式插件，强制路由config/route.php，api版本目录
Route::get('/','v1.Index/index');
Route::get('AllDb','v1.Index/AllDb');

//allowCrossDomain() 指定路由支持跨域
//添加喂食记录
Route::post('add','v1.BabyFace/save')->allowCrossDomain();
//获取最近一条喂养记录
Route::get('read/:user_id/[:ischoose]/[:bb_id]','v1.BabyFace/read')->allowCrossDomain();
//获取当天指定宝宝喂养次数
//Route::get('getNum/:user_id/:bb_id','v1.BabyFace/getNum')->allowCrossDomain();
//bb_id为可选参数
Route::get('readUserLog/:user_id/[:bb_id]','v1.BabyFace/ReadUserLog')->allowCrossDomain();
//获取用户添加宝宝
Route::get('getBaby/:uid','v1.BabyFace/getBaby')->allowCrossDomain();
//获取指定喂养记录并修改记录
Route::get('readone/:id','v1.BabyFace/readone')->allowCrossDomain();
Route::put('edit/:id','v1.BabyFace/editBabyLog')->allowCrossDomain();
//添加baby
Route::post('addBaby','v1.BabyFace/addBaby')->allowCrossDomain();
//获取微信用户信息、openid
Route::post('getuserinfo','v1.BabyFace/getuserinfo')->allowCrossDomain();
//添加用户
Route::post('addMembers','v1.BabyMembers/addMembers')->allowCrossDomain();

//---------------------------V2------------------------------
//添加用户
Route::post('autoAddUser','v2.BabyFace/autoAddUser')->allowCrossDomain();
//添加喂食记录
Route::post('addMilk','v2.BabyFace/addMilk')->allowCrossDomain();
//添加宝宝
Route::post('addBaby2','v2.BabyFace/addBaby')->allowCrossDomain();
//获取喂养记录
Route::get('getList/:uid/[:bid]','v2.BabyFace/getList')->allowCrossDomain();
//获取宝宝信息getBabyInfo
Route::get('getBabyInfo2/:bid','v2.BabyFace/getBabyInfo')->allowCrossDomain();
//获取宝宝当天喂养次数getNum
Route::get('getNum/:bid','v2.BabyFace/getNum')->allowCrossDomain();
//获取最近一次宝宝喂养数据
Route::get('getMilk/:bid','v2.BabyFace/getMilk')->allowCrossDomain();
//TODO 明天计划，优化添加宝宝页面，宝宝管理页面
//编辑宝宝信息
Route::put('editBaby','v2.BabyFace/editBaby')->allowCrossDomain();
//获取用户的宝宝
Route::get('getBabyList/:uid','v2.BabyFace/getBaby')->allowCrossDomain();
//获取用户基本信息
Route::get('getUserInfo2/:uid','v2.BabyMembers/getUserInfo')->allowCrossDomain();
//设置宝宝默认状态
Route::get('modDefault/:uid/:bb_id','v2.BabyFace/modDefault')->allowCrossDomain();
//-------------------------测试用---------------------------

//查询最近一天的数据
Route::get('getlastday/:user_id/:bb_id/:isCount','v1.BabyMembers/getlastday');
Route::get('getalllist/:uid','v2.BabyFace/getalllist');
//一对多，通过宝宝ID关联查询喂养记录-----在列表需要跟头部一致时可以用
Route::get('getBabyLog/:bb_id','v2.BabyFace/getBabyLog');

